package ee.siimkaspar.subjects.model;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@Entity
@Table(name = "contact_type")
public class ContactType implements Serializable, ModelInterface {

	@Id
	@Column(name = "contact_type", unique = true, nullable = false)
	private Integer id;
	@Column(name = "type_name", length = 200)
	private String typeName;
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contactType")
	private List<Contact> contacts = new ArrayList<Contact>();

	public ContactType() {
	}

	// public ContactType(int contactType) {
	// this.contactType = contactType;
	// }
	//
	// public ContactType(int contactType, String typeName, Set contacts) {
	// this.contactType = contactType;
	// this.typeName = typeName;
	// this.contacts = contacts;
	// }

	@Override
	public Integer getId() {
		return id;
	}

	@Override
	public void setId(Integer id) {
		this.id = id;
	}

	public String getTypeName() {
		return this.typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public List<Contact> getContacts() {
		return contacts;
	}

	public void setContacts(List<Contact> contacts) {
		this.contacts = contacts;
	}
	@Override
	public boolean validate() {
		// TODO Auto-generated method stub
		return true;
	}
}
